﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models.Constant
{
    public class JiDianQiCommandEnum
    {
        /// <summary>
        /// 开
        /// </summary>
        public const string JiDianQi_OPEN = "open";
        /// <summary>
        /// 关
        /// </summary>
        public const string JiDianQi_CLOSE = "close";


        /// <summary>
        /// 查状态
        /// </summary>
        public const string JiDianQi_CHECK_STATE = "check_state";

        /// <summary>
        /// 返回状态 开  针对wifi带回传功能的继电器，返回的return_open 指令 跟上面 open的指令不一样，所以单独设置了 返回 开 状态，而不共用上面的open
        /// </summary>
        public const string JiDianQi_RETURN_OPEN = "return_open";
        /// <summary>
        /// 返回状态 关 针对wifi带回传功能的继电器
        /// </summary>
        public const string JiDianQi_RETURN_CLOSE = "return_close";
        /// <summary>
        /// 异常
        /// </summary>
        public const string JiDianQi_RETURN_ERROR = "return_error";

        /// <summary>
        /// ok
        /// </summary>
        public const string JiDianQi_RETURN_OK = "return_ok";



        public static int getReturnStatus(string msg)
        {
            if (msg == JiDianQi_RETURN_OK || msg == JiDianQi_RETURN_OPEN || msg == JiDianQi_RETURN_CLOSE || msg == JiDianQi_OPEN || msg == JiDianQi_CLOSE)
            {
                //正常
                return 2;
            }
            else if (msg == JiDianQi_RETURN_ERROR)
            {
                //异常
                return 3;
            }
            else
            {
                return 100;
            }
        }

    }
}
